var b = 1;
var previosepic = "whitepointer.png";
var previosepicall = "";
$(".roundsliderpoints").css("background-image", "url(/img/whitepointer.png)");
$(".roundsliderpoints[title=" + b + "]").css("background-image", "url(/img/greypointer.png)");

$(".roundsliderpoints").click(function(){
    b = $(this).attr("title");
    $(".roundsliderpoints").css("background-image", "url(/img/whitepointer.png)");
    $(".sliderfield").animate({"scrollLeft": (b - 1) * 960}, "slow");
    $(this).css("background-image", "url(/img/greypointer.png)");
    previosepic = "url(/img/greypointer.png)";
    return false;
});

$(".roundsliderpoints").mouseover(
    function(){
        previosepicall = $(this).css("background-image");
        previosepic = previosepicall.substring(previosepicall.length - 18, previosepicall.length - 2);
        $(this).css("background-image", "url(/img/blackpointer.png)");
    }
);

$(".roundsliderpoints").mouseout(
    function(){
        $(this).css("background-image", "url(/img/" + previosepic + ")");
    }
);

$(window).keydown(function(event){
    switch (event.keyCode){
        case 37:
            if(event.ctrlKey == true || event.shiftKey == true){
                if(b > 1){
                    b--;
                    $(".roundsliderpoints").css("background-image", "url(/img/whitepointer.png)");
                    $(".sliderfield").animate({"scrollLeft": (b - 1) * 960}, "slow");
                    $(".roundsliderpoints[title=" + b + "]").css("background-image", "url(/img/greypointer.png)");
                }
            }
	break;
	case 39:
            if(event.ctrlKey == true || event.shiftKey == true){
                if(b < 2){
                    $(".roundsliderpoints").css("background-image", "url(/img/whitepointer.png)");
                    $(".sliderfield").animate({"scrollLeft": b++ * 960}, "slow");
                    $(".roundsliderpoints[title=" + b + "]").css("background-image", "url(/img/greypointer.png)");
                }
            }
	break;
    }
});
